\subsection{Chain complexes}
\begin{definition}
	A \emph{(finitely generated) chain complex} \( (C_\bullet, d) \) is
	\begin{enumerate}
		\item a collection of free (finitely generated) abelian groups \( C_i \) for \( i \in \mathbb Z \) (and if finitely generated, \( C_i = 0 \) for all but finitely many \( i \));
		\item a collection of homomorphisms \( d_i \colon C_i \to C_{i-1} \);
		\item \( d_{i-1} \circ d_i = 0 \) for all \( i \).
	\end{enumerate}
	\begin{center}
		\begin{tikzcd}
			\cdots & {C_{-2}} & {C_{-1}} & {C_0} & {C_1} & {C_2} & \cdots
			\arrow["{d_3}"', from=1-7, to=1-6]
			\arrow["{d_2}"', from=1-6, to=1-5]
			\arrow["{d_1}"', from=1-5, to=1-4]
			\arrow["{d_0}"', from=1-4, to=1-3]
			\arrow["{d_{-1}}"', from=1-3, to=1-2]
			\arrow["{d_{-2}}"', from=1-2, to=1-1]
		\end{tikzcd}
	\end{center}
\end{definition}
Usually, we write \( C_\bullet = \bigoplus_i C_i \), and \( d = \bigoplus_i d_i \colon C_\bullet \to C_\bullet \).
We can check that \( d_{i-1} \circ d_i = 0 \) for all \( i \) is equivalent to the statement that \( d \circ d = d^2 = 0 \).
\begin{remark}
	Free finitely generated abelian groups are isomorphic to \( \mathbb Z^n \) for some \( n \).
	A chain complex defined over \( \mathbb Q \), \( \mathbb R \), or \( \mathbb F_p \) is similar, except that \( C_i \) is a vector space over the \( \mathbb Q, \mathbb R, \mathbb F_p \) and the \( d_i \) are linear maps.
	Every chain complex determines another chain complex over \( \mathbb Q, \mathbb R, \mathbb F_p \) by replacing \( \mathbb Z^{n_i} \) with \( \mathbb Q^{n_i} \), for example, and the \( d_i \) are given by the same matrices.
\end{remark}
\begin{remark}
	There is a unique group homomorphism to and from the trivial abelian group \( 0 \).
	Arrows to and from this group can therefore be unlabelled.
\end{remark}
\begin{example}[reduced chain complex of the simplex]
	Consider the reduced chain complex of \( \Delta^n \).
	We define \( \widetilde C_k(\Delta^n) = \genset{e_I \mid \abs{I} = k + 1, I \subseteq \qty{0, \dots, n}} \), the free abelian group on a basis given by the \( e_I \).
	We also define \( d(e_I) = \sum_{j=0}^{\abs{I}} (-1)^j e_{I_{\hat\jmath}} \) where if \( I = i_0 i_1 \dots i_k \) and \( i_0 < \dots < i_k \), we define \( I_{\hat\jmath} = I \setminus \qty{i_j} \).
	For example, consider \( \widetilde C_\bullet(\Delta^2) \).
	\[ \widetilde C_2(\Delta^2) = \genset{e_{012}};\quad \widetilde C_1(\Delta^2) = \genset{e_{01}, e_{02}, e_{12}};\quad \widetilde C_0(\Delta^2) = \qty{e_0, e_1, e_2};\quad \widetilde C_{-1}(\Delta^2) = \qty{e_\varnothing} \]
	and, for example,
	\[ d(e_{012}) = (-1)^0 e_{12} + (-1)^1 e_{02} + (-1)^2 e_{01} = e_{12} - e_{02} + e_{01} \]
	\[ d(e_{01}) = e_1 - e_0;\quad d(e_{02}) = e_2 - e_0;\quad d(e_{12}) = e_2 - e_1;\quad d(e_0) = d(e_1) = d(e_2) = e_\varnothing \]
	Note that \( \widetilde C_i(\Delta^2) = 0 \) if \( i < -1 \) or \( i > 2 \).
	We have \( d^2(e_{012}) = d(e_{12} - e_{02} + e_{01}) = e_2 - e_1 - e_2 + e_0 + e_1 - e_0 = 0 \), as required.
	\begin{center}
		\begin{tikzcd}
			0 & {\widetilde C_{-1}} & {\widetilde C_0} & {\widetilde C_1} & {\widetilde C_2} & 0
			\arrow[from=1-6, to=1-5]
			\arrow["{d_2}"', from=1-5, to=1-4]
			\arrow["{d_1}"', from=1-4, to=1-3]
			\arrow["{d_0}"', from=1-3, to=1-2]
			\arrow[from=1-2, to=1-1]
		\end{tikzcd}
	\end{center}
\end{example}
\begin{proposition}
	For \( \widetilde C_\bullet(\Delta^n) \), \( d^2 = 0 \).
\end{proposition}
\begin{proof}
	The \( e_I \) are a basis for \( \widetilde C_\bullet(\Delta^n) \), so it suffices to check that \( d^2(e_I) = 0 \) for each \( I \).
	For some \( c_{jj'} \), we have \( d^2(e_I) = \sum_{j<j'} c_{jj'} e_{I_{\hat\jmath,\hat\jmath'}} \) where \( I_{\hat\jmath,\hat\jmath'} = I \setminus \qty{i_j, i_{j'}} \).
	We can compute that \( c_{jj'} \) has a contribution of \( (-1)^j (-1)^{j' - 1} \) by first considering \( j \) then \( j' \), since \( i_{j'} \) is the \( (j'-1) \)th element of \( I_{\hat\jmath} \).
	Note also that by computing the term in the sum with \( j, j' \) in the other order, we have a contribution of \( (-1)^{j'} (-1)^i \).
	Hence \( c_{jj'} = (-1)^j (-1)^{j'-1} + (-1)^{j'} (-1)^i = 0 \).
\end{proof}
\begin{example}[chain complex of the simplex]
	The chain complex of \( \Delta^n \) is defined by \( C_i(\Delta^n) = \widetilde C_i(\Delta^n) \) if \( i \geq 0 \), but \( C_{-1}(\Delta^n) = 0 \).
	This removes the empty face \( e_\varnothing \).
	The \( d_i \) are unchanged.
	\begin{center}
		\begin{tikzcd}
			0 & {C_0} & {C_1} & {C_2} & 0
			\arrow[from=1-5, to=1-4]
			\arrow["{d_2}"', from=1-4, to=1-3]
			\arrow["{d_1}"', from=1-3, to=1-2]
			\arrow[from=1-2, to=1-1]
		\end{tikzcd}
	\end{center}
\end{example}
\begin{definition}
	Let \( K \) be an abstract simplicial complex in \( \Delta^n \).
	Let
	\[ \widetilde C_k(K) = \genset{e_I \mid \abs{I} = k + 1, e_I \in K} \leq \widetilde C_k(\Delta^n) \]
	Since \( e_I \in K \) implies \( e_{I_{\hat\jmath}} \in K \), \( d_k \colon \widetilde C_k(K) \to \widetilde C_{k-1}(K) \).
	So \( (\widetilde C_\bullet(K), d) \) is a chain complex.
\end{definition}
\begin{definition}
	Let \( (C_\bullet, d) \) be a chain complex, and let \( x \in C_k \).
	We say that \( x \) is a \emph{cycle} or \emph{closed} if \( d x = 0 \), so \( x \in \ker d_k \).
	We say that \( x \) is a \emph{boundary} or \emph{exact} if \( x = d y \) for some \( y \), so \( x \in \Im d_{k+1} \).
\end{definition}
\begin{remark}
	The statement \( d^2 = 0 \) is equivalent to the statement \( \Im d_{k+1} \subseteq \ker d_k \) for each \( k \), so boundaries are always cycles.
\end{remark}

\subsection{Homology groups}
\begin{definition}
	Let \( (C_\bullet, d) \) be a chain complex.
	Its \emph{\( k \)th homology group} is
	\[ H_k(C) = \faktor{\ker d_k}{\Im d_{k+1}} \]
\end{definition}
\begin{remark}
	Homology groups are abelian.
\end{remark}
\begin{example}
	Consider \( \widetilde C_\bullet(\Delta^2) \).
	Recall \( \widetilde C_2 = \genset{e_{012}} \) and \( d(e_{012}) = e_{12} - e_{02} + e_{01} \).
	Hence \( \ker d_2 = 0 \) and \( \Im d_3 = 0 \), so \( H_2(\widetilde C_\bullet(\Delta^2)) = 0 \).

	We have \( \widetilde C_1 = \genset{e_{12}, e_{02}, e_{01}} \), and \( d(ae_{01} + be_{12} + ce_{02}) = a(e_1 - e_0) + b(e_2 - e_1) + c(e_2 - e_0) = -(a+c)e_0 + (a-b)e_1 + (b+c)e_2 \).
	Hence \( ae_{01} + be_{12} + ce_{02} \in \ker d \) if and only if \( a = b = -c \).
	So \( x \in \genset{e_{12} - e_{02} + e_{01}} = \Im d_2 \), giving \( H_1(\widetilde C_\bullet(\Delta^2)) = 0 \).

	We have \( \widetilde C_0 = \genset{e_0, e_1, e_2} \) and \( d(e_i) = e_\varnothing \), so \( \ker d_0 = \qty{a e_0 + b e_1 + c e_2 \mid a + b + c = 0} \).
	Conversely, \( \Im d_1 = \vecspan\qty{e_1 - e_0, e_2 - e_0, e_2 - e_1} = \ker d_0 \).
	So in fact \( H_0(\widetilde C_\bullet(\Delta^2)) = 0 \).

	Now \( \widetilde C_{-1} = \genset{e_\varnothing} = \ker d_{-1} = \genset{e_\varnothing} = \Im d_0 \) so \( H_{-1}(\widetilde C_\bullet(\Delta^2)) = 0 \).
	So all of the homology groups of \( \widetilde C_\bullet(\Delta^2) \) are trivial.
	Note that
	\[ H_i(C_\bullet(\Delta^2)) = \begin{cases}
		H_i(\widetilde C_\bullet(\Delta^2)) & i > 0 \\
		\faktor{\genset{e_0, e_1, e_2}}{\vecspan\qty{e_1 - e_0, e_2 - e_0, e_2 - e_1}} \simeq \mathbb Z & i = 0
	\end{cases} \]
\end{example}
\begin{definition}
	Let \( K \) be an abstract simplicial complex in \( \Delta^n \).
	Then we define the \( i \)th reduced homology group of \( K \) to be \( \widetilde H_i(K) = H_i(\widetilde C_\bullet(K)) \).
	Then \( C_\bullet(K) = \faktor{\widetilde C_\bullet(K)}{\genset{e_\varnothing}} \) is a chain complex, and \( H_i(K) = H_i(C_\bullet(K)) \) is the \( i \)th homology group of \( K \).
\end{definition}
\begin{example}
	Let \( K = \qty{e_0, e_1, \dots, e_r, e_\varnothing} \), so \( \abs{K} \) is a collection of \( r + 1 \) disjoint points.
	In this case, \( \widetilde C_i(K) = 0 \) for \( i > 0 \).
	\( \widetilde C_0(K) = \genset{e_0, \dots, e_r} \) and \( d(e_i) = \varnothing \).
	\( \widetilde C_{-1}(K) = \genset{e_\varnothing} \).
	Hence \( \ker d_0 = \genset{e_1-e_0, \dots, e_r-e_0} \) and \( \Im d_1 = 0 \), so \( H_0(\widetilde C_\bullet(K)) = \mathbb Z^r \), and \( H_{-1}(\widetilde C_\bullet(K)) = 0 \).
	Note that \( H_0(C_\bullet(K)) = \mathbb Z^{r+1} = \genset{e_0, \dots, e_r} \).
\end{example}
\begin{example}
	Recall that any Euclidean simplicial complex is realised by an abstract simplicial complex, but we have choice in the labelling of the vertices.
	Let \( T_n \) be the boundary of a convex \( n \)-gon in \( \mathbb R^2 \).
	Then the abstract simplicial complex
	\[ K' = \qty{e_\varnothing, e_0, \dots, e_{n-1}, e_{01}, e_{12}, \dots, e_{(n-2)(n-1)}, e_{(n-1)0}} \]
	in \( \Delta^{n-1} \) realises \( T_n \).
	Then
	\begin{align*}
		C_1(K') &= \genset{e_{01}, e_{12}, \dots, e_{(n-2)(n-1)}, e_{(n-1)0}} \\
		C_0(K') &= \genset{e_0, \dots, e_{n-1}}
	\end{align*}
	We have \( d(e_{i(i+1)}) = e_{i+1} - e_i \), so \( \ker d_1 = \genset{x} \) where
	\[ x = e_{01} + e_{12} + \dots + e_{(n-2)(n-1)} - e_{0(n-1)} \]
	Note that \( \Im d_1 = \vecspan\qty{e_{i+1} - e_i} \).
	Hence
	\begin{align*}
		H_1(K') &= \faktor{\ker d_1}{\Im d_2} = \faktor{\genset{x}}{0} \simeq \mathbb Z \\
		H_0(K') &= \faktor{\ker d_0}{\Im d_1} = \faktor{\genset{e_0, \dots, e_{n-1}}}{\vecspan\qty{e_1 - e_0, \dots, e_{n-1} - e_{n-2}}} \simeq \mathbb Z
	\end{align*}
	Note that this result does not depend on the choice of \( n \), and \( \abs{T_n} \simeq S^1 \) also does not depend on \( n \).
	In fact, \( H_\bullet(K) \) depends only on \( \abs{K} \).
\end{example}

\subsection{Chain maps}
\begin{definition}
	Let \( (C_\bullet, d) \) and \( (C_\bullet', d') \) be chain complexes.
	A \emph{chain map} \( f \colon C_\bullet \to C_\bullet' \) is
	\begin{enumerate}
		\item for each \( i \), a homomorphism \( f_i \colon C_i \to C_i' \), such that
		\item \( f_{i-1} \circ d_i = d_i' \circ f_i \).
	\end{enumerate}
\end{definition}
\begin{remark}
	We can interpret \( f \) as \( \bigoplus_i f_i \colon C_\bullet \to C_\bullet' \), given by a block matrix
	\[ \begin{pmatrix}
		f_n \\
		& f_{n-1} \\
		& & \ddots
	\end{pmatrix} \]
	Then part (ii) of the definition is equivalent to the statement \( d' f = f d \).
\end{remark}
If \( x \in \ker d \), we write \( [x] \in H_\bullet(C) \) for its image under the map \( \ker d \to \faktor{\ker d}{\Im d} \).
\begin{remark}
	\( f(\ker d) \subseteq \ker d' \) because if \( dx = 0 \), we have \( d'(f(x)) = f(d(x)) = f(0) = 0 \).
	\( f(\Im d) \subseteq \Im d' \), because if \( x = dy \), we have \( f(x) = f(d(y)) = d'(f(y)) \).
	So \( f \) descends to a well-defined homomorphism \( f_\star \colon \faktor{\ker d}{\Im d} \to \faktor{\ker d'}{\Im d'} \) such that \( f_\star([x]) = [f(x)] \).
	So \( f_\star \colon H_\bullet(C) \to H_\bullet(C') \).
	This is called the map \emph{induced by} \( f \).
\end{remark}
\begin{remark}
	The composition of two chain maps is a chain map, and \( (f \circ g)_\star = f_\star \circ g_\star \).
\end{remark}
Let \( K \) be an abstract simplicial complex in \( \Delta^n \), and \( L \) be an abstract simplicial complex in \( \Delta^m \).
Let \( f \colon K \to L \) be a simplicial map, so it is determined by \( \hat f \colon \qty{0, \dots, n} \to \qty{0, \dots, m} \).
We wish to define a chain map \( f_\sharp \colon C_\bullet(K) \to C_\bullet(L) \), which will induce \( f_\star \colon H_\bullet(K) \to H_\bullet(L) \).
Perhaps the most obvious guess would be to define \( f_\sharp(e_I) = f(e_I) = e_{\hat f(I)} \).
This is not the correct definition.

First, consider \( f \colon \bm \Delta^1 \to \bm \Delta^1 \) given by \( e_0 \mapsto e_0 \), \( e_1 \mapsto e_0 \).
Then \( f(e_{01}) = e_0 \), but \( e_{01} \in C_1(\bm\Delta^1) \) and \( e_0 \in C_0(\bm\Delta^1) \).
So \( f \) does not preserve grading, and hence cannot be a chain map.

Consider also \( f \colon \bm\Delta^1 \to \bm\Delta^1 \) given by \( e_0 \mapsto e_1 \) and \( e_1 \mapsto e_0 \).
Now, \( f(e_{01}) = e_{01}, f(e_0) = e_1, f(e_1) = e_0 \), so \( df(e_{01}) = d(e_{01}) = e_1 - e_0 \) but \( fd(e_{01}) = f(e_1 - e_0) = e_0 - e_1 \).

The solution to both problems is to change our perspective on the indices \( I \).
Until now, we have defined \( I \subseteq \qty{0, \dots, n} \) and written \( I = i_0 i_1 \dots i_k \) where \( i_0 < \dots < i_k \).
Instead, we will allow \( I \in \qty{0, \dots, n}^{k+1} \), so \( I = (i_0, i_1, \dots, i_k) = i_0 i_1 \dots i_k \) with no restriction on order.
For instance, \( e_{00}, e_{10} \) are permitted.

We impose relations on the set of all such \( I \) to form an abelian group generated by equivalence classes of the \( \qty{0, \dots, n}^{k+1} \).
We will define that \( e_I = -e_{I'} \) when \( I, I' \) are related by switching two indices; so \( e_{102} = -e_{012} = e_{210} \).
If \( e_I \) contains a repetition, we require \( e_I = 0 \).

More concretely, if \( I \in \qty{0, \dots, n}^{k+1} \), let \( I' \) be the unique ordered permutation of \( I \) if \( I \) has no repetitions.
Then \( e_I = (-1)^{S(I)} e_{I'} \) if \( I \) has no repetitions, and \( e_I = 0 \) if \( I \) has a repetition, where \( (-1)^{S(I)} \) is the sign of the permutation \( \sigma \in S^{k+1} \) mapping \( I \) to \( I' \).
If we draw \( I \) and \( I' \) in order as a bipartite planar graph, connected by matching labels, \( S(I) \) is the number of crossings.
\begin{lemma}
	Let \( i_j \in I \), and suppose \( i_j \) is in position \( i_{j'} \) in \( I' \).
	Then \( S(I) - S(I_{\hat\jmath}) \equiv j - j' \text{ mod } 2 \).
\end{lemma}
\begin{proposition}
	Let \( I \in \qty{0, \dots, n}^{k+1} \).
	Then \( d(e_I) = \sum_{j=0}^k (-1)^j e_{I_{\hat\jmath}} \), where \( I_{\hat\jmath} \) is obtained from \( I \) by omitting the \( j \)th entry in the tuple \( I \).
\end{proposition}
We have already defined \( d \) for ordered sequences of indices; this proposition states that this formula holds for all sequences of indices.
\begin{proof}
	\[ \sum_{j=0}^k (-1)^k e_{I_{\hat\jmath}} = \sum_{j=0}^k (-1)^j (-1)^{S(I_{\hat\jmath})} e_{I_{\hat\jmath}'} = \sum_{j=0}^k (-1)^{j'} (-1)^{S(I)} e_{(I')_{\hat\jmath}} = (-1)^{S(I)} d(e_{I'}) = d(e_I) \]
\end{proof}
\begin{example}
	\( d(e_{210}) = (-1)^0 e_{10} + (-1)^1 e_{20} + (-1)^2 e_{21} = -e_{01} + e_{02} - e_{12} = d(-e_{012}) \), where by definition, \( e_{210} = -e_{012} \) so \( d(e_{210}) = -d(e_{012}) \).
\end{example}
\begin{definition}
	Let \( f \colon K \to L \) be a simplicial map.
	Then \( f_\sharp \colon C_k(K) \to C_k(L) \) is defined by \( f_\sharp(e_I) = e_{\hat f(I)} \) where if \( I = (i_0, \dots, i_k) \) we define \( \hat f(I) = (\hat f(i_0), \dots, \hat f(i_k)) \).
\end{definition}
This definition of \( f_\sharp \) preserves grading.
\begin{proposition}
	\( f_\sharp \) is a chain map.
\end{proposition}
\begin{proof}
	\[ d(f_\sharp(e_I)) = d(e_{\hat f(I)}) = \sum_{j=0}^k (-1)^j e_{(\hat f(I))_{\hat \jmath}} = f_\sharp\qty(\sum_{j=0}^k (-1)^j e_{I_{\hat\jmath}}) = f_\sharp(d(e_I)) \]
\end{proof}
\begin{example}
	Let \( f \colon \bm\Delta^1 \to \bm\Delta^1 \) be the simplicial map defined by \( f(e_0) = e_0 \) and \( f(e_1) = e_0 \).
	Then \( f_\sharp(e_{01}) = e_{00} = 0 \).

	Now let \( f(e_0) = e_1 \) and \( f(e_1) = e_0 \).
	Then \( f_\sharp(e_{01}) = e_{10} = -e_{01}, f_\sharp(e_0) = e_1, f_\sharp(e_1) = e_0 \).
	So \( d(f_\sharp(e_{01})) = -d(e_{01}) = e_0 - e_1 = f(d(e_{01})) \).
\end{example}

\subsection{Chain homotopies}
\begin{definition}
	Let \( f_0, f_1 \colon (C, d) \to (C', d') \) be chain maps.
	Then \( f_0 \) is \emph{chain homotopic} to \( f_1 \), written \( f_0 \sim f_1 \), if there are
	\begin{enumerate}
		\item homomorphisms \( h_i \colon C_i \to C_{i+1}' \), where we write \( h = \bigoplus_i h_i \), satisfying
		\item \( d'h + hd = f_0 - f_1 \).
	\end{enumerate}
	In this case, we say \( h \) is the \emph{chain homotopy}.
\end{definition}
\begin{example}
	Suppose \( f_0, f_1 \colon X \to Y \) are homotopic maps via \( H \).
	Suppose \( X = \Delta^n \).
	\ctikzfig{im_homotopy}
	Here,
	\[ \partial(H(\Delta^n)) = H(\partial\Delta^n) \cup f_1(\Delta^n) \cup f_0(\Delta^n) \implies \partial H + H \partial = f_1 + f_0 \]
	without considering signs.
\end{example}
\begin{lemma}
	If \( f_1 \sim f_0 \), then \( f_{1\star} = f_{0\star} \colon H_\bullet(C) \to H_\bullet(C') \).
\end{lemma}
\begin{proof}
	Let \( [x] \in H_\bullet(C) \).
	Then \( dx = 0 \).
	So
	\[ f_{1\star}[x] - f_{0\star}[x] = [(f_1 - f_0)x] = [(d'h + hd)x] = [d'h(x)] = 0 \]
	since \( d'h(x) \in \Im d' \).
\end{proof}
\begin{definition}
	We say a chain complex \( (C, d) \) is \emph{contractible} if \( \mathrm{id}_C \sim 0_C \), where \( 0_C \) is the zero map.
\end{definition}
\begin{lemma}
	Let \( (C, d) \) be contractible.
	Then \( H_\bullet(C) = 0 \).
\end{lemma}
\begin{proof}
	Let \( [x] \in H_\bullet(C) \).
	Then \( [x] = \mathrm{id}_\star[x] = 0_\star[x] = [0] \).
	So \( H_k(C) \) is the trivial group for each \( k \).
\end{proof}
\begin{definition}
	Let \( K \) be an abstract simplicial complex in \( \Delta^n \).
	Let \( e_0 \not\in K \).
	Then the \emph{cone} is \( C_{e_0}(K) = K \cup \qty{e_{0I} \mid e_I \in K} \).
\end{definition}
\begin{remark}
	\( C_{e_0}(K) \) is an abstract simplicial complex.
	If \( K' \) is a realisation of \( K \), where \( e_0 \not\in K \) and \( K' \) is independent of \( p \), then \( C_p(K') \) is a realisation of \( C_{e_0}(K) \).
\end{remark}
\begin{example}
	Consider \( \hat{\bm \Delta} ^n= \qty{e_I \in \bm \Delta^{n+1} \mid 0 \not\in I} \simeq \bm\Delta^n \).
	Then \( C_{e_0}(\hat{\bm \Delta} ^n) = \bm \Delta^{n+1} \).
\end{example}
\begin{proposition}
	\( \widetilde C_\bullet(C_{e_0}(K)) \) is contractible.
\end{proposition}
\begin{proof}
	Define \( h \colon \widetilde C_k(C_{e_0}(K)) \to \widetilde C_{k+1}(C_{e_0}(K)) \) by \( h(e_I) = e_{0I} \).
	Note that if \( 0 \in I \), then \( e_{0I} = 0 \).

	If \( 0 \in I \) then \( dh(e_I) = 0 \), and \( hd(e_I) = h\qty(\sum_{j=0}^k (-1)^j e_{I_{\hat\jmath}}) = h(e_{I \setminus \qty{0}} + \sum e_{I'}) \) where \( 0 \in I' \).
	Then \( hd(e_I) = e_I + 0 = e_I \).
	Otherwise, if \( 0 \not\in I \), then \( dh(e_I) = d(e_{0I}) = e_I + \sum_{j=0}^k (-1)^{k+1} e_{0I_{\hat\jmath}} = e_I - h(de_I) \).
	In either case, \( dh + hd = \mathrm{id} \).
\end{proof}
\begin{corollary}
	\( \widetilde H_\bullet(C_{e_0}(K)) = 0 \).
	In particular,
	\[ H_i(C_{e_0}(K)) = \begin{cases}
		\mathbb Z & i = 0 \\
		0 & i \neq 0
	\end{cases} \]
\end{corollary}
\begin{proof}
	Let \( \widetilde C_\bullet(C_{e_0}(K)) = (\widetilde C, \widetilde d) \), and \( C_\bullet(C_{e_0}(K)) = (C, d) \).
	The first part follows from the previous result.
	For the second part, note that \( \widetilde H_{-1}(C_{e_0}(K)) = 0 \), so \( \widetilde d_0 \colon \widetilde C_0 \to \widetilde C_{-1} = \genset{e_\varnothing} \simeq \mathbb Z \) is surjective.
	So \( \mathbb Z \simeq \Im \widetilde d_0 \simeq \faktor{\widetilde C_0}{\ker \widetilde d_0} \simeq \faktor{\widetilde C_0}{\Im \widetilde d_1} \) since \( \widetilde H_0(C) = 0 \).
	But \( \faktor{\widetilde C_0}{\Im \widetilde d_1} \simeq \faktor{C_0}{\Im d_1} = \faktor{\ker d_0}{\Im d_1} = H_0(C_{e_0}(K)) \).
	For \( i \geq 0 \), note that \( \ker \widetilde d_i = \ker d_i \) and \( \Im \widetilde d_{i+1} = \Im d_{i+1} \).
	Hence \( H_i(\widetilde C) = H_i(C) \) for \( i > 0 \).
\end{proof}
\begin{definition}
	Let \( \mathbb S^n = \bm\Delta^n \setminus e_{0\dots n} \).
	Then
	\[ H_i(\mathbb S^n) = \begin{cases}
		\mathbb Z & i = 0, n \\
		0 & \text{otherwise}
	\end{cases} \]
\end{definition}
\begin{proof}
	Similar to the previous proof, but now we remove the `top' generator instead of the `bottom' one.
\end{proof}
Alternatively, we can prove this fact using the results from the next subsection.

\subsection{Exact sequences}
\begin{definition}
	Let \( A_k \) be a sequence of abelian groups for \( k \in \mathbb Z \), and \( f_k \colon A_k \to A_{k-1} \) be homomorphisms.
	We say that the sequence is \emph{exact} at \( A_k \) if \( \ker f_k = \Im f_{k+1} \).
	If it is exact at all \( A_k \), we say the sequence is exact.
	\begin{center}
		\begin{tikzcd}
			\cdots & {A_{k+1}} & {A_k} & {A_{k-1}} & \cdots
			\arrow["{f_{k+2}}", from=1-1, to=1-2]
			\arrow["{f_{k+1}}", from=1-2, to=1-3]
			\arrow["{f_k}", from=1-3, to=1-4]
			\arrow["{f_{k-1}}", from=1-4, to=1-5]
		\end{tikzcd}
	\end{center}
\end{definition}
\begin{example}
	\[ \begin{tikzcd}
		0 & A & B
		\arrow[from=1-1, to=1-2]
		\arrow["f", from=1-2, to=1-3]
	\end{tikzcd} \]
	is exact at \( A \) if and only if \( f \) is injective.
	\[ \begin{tikzcd}
		B & C & 0
		\arrow["g", from=1-1, to=1-2]
		\arrow[from=1-2, to=1-3]
	\end{tikzcd} \]
	is exact at \( C \) if and only if \( g \) is surjective.
	\[ \begin{tikzcd}
		0 & A & B & C & 0
		\arrow[from=1-1, to=1-2]
		\arrow["f", from=1-2, to=1-3]
		\arrow["g", from=1-3, to=1-4]
		\arrow[from=1-4, to=1-5]
	\end{tikzcd} \]
	is exact if and only if \( f \) is injective, \( g \) is surjective, and \( g \colon \faktor{B}{\Im f} \to C \) is an isomorphism, so \( C \simeq \faktor{B}{\Im f} \).
	An exact sequence of the form
	\[ \begin{tikzcd}
		0 & A & B & C & 0
		\arrow[from=1-1, to=1-2]
		\arrow["f", from=1-2, to=1-3]
		\arrow["g", from=1-3, to=1-4]
		\arrow[from=1-4, to=1-5]
	\end{tikzcd} \]
	is called a \emph{short exact sequence}.
\end{example}
\begin{definition}
	Let \( g \colon B \to C \).
	Then the \emph{cokernel} of \( g \) is \( \coker g = \faktor{C}{\Im g} \).
\end{definition}
In general, a sequence is exact if and only if
\[ \begin{tikzcd}
	0 & {\coker f_{k+1}} & {A_k} & {\ker f_{k-1}} & 0
	\arrow[from=1-1, to=1-2]
	\arrow["{f_{k+1}}", from=1-2, to=1-3]
	\arrow["{f_k}", from=1-3, to=1-4]
	\arrow[from=1-4, to=1-5]
\end{tikzcd} \]
is a short exact sequence for every \( k \).
\begin{definition}
	A short exact sequence of chain complexes is a short exact sequence
	\[ \begin{tikzcd}
		0 & {A_\bullet} & {B_\bullet} & {C_\bullet} & 0
		\arrow[from=1-1, to=1-2]
		\arrow["f", from=1-2, to=1-3]
		\arrow["g", from=1-3, to=1-4]
		\arrow[from=1-4, to=1-5]
	\end{tikzcd} \]
	where \( A_\bullet, B_\bullet, C_\bullet \) are chain complexes, and \( f, g \) are chain maps.
\end{definition}
Equivalently, we have the diagram
\begin{center}
	\begin{tikzcd}
		& \vdots & \vdots & \vdots \\
		0 & {A_k} & {B_k} & {C_k} & 0 \\
		0 & {A_{k-1}} & {B_{k-1}} & {C_{k-1}} & 0 \\
		0 & {A_{k-2}} & {B_{k-2}} & {C_{k-2}} & 0 \\
		& \vdots & \vdots & \vdots
		\arrow[from=2-1, to=2-2]
		\arrow["f", from=2-2, to=2-3]
		\arrow["g", from=2-3, to=2-4]
		\arrow[from=2-4, to=2-5]
		\arrow[from=3-1, to=3-2]
		\arrow["f", from=3-2, to=3-3]
		\arrow["g", from=3-3, to=3-4]
		\arrow[from=3-4, to=3-5]
		\arrow[from=4-1, to=4-2]
		\arrow["f", from=4-2, to=4-3]
		\arrow["g", from=4-3, to=4-4]
		\arrow[from=4-4, to=4-5]
		\arrow["{d_A}", from=1-2, to=2-2]
		\arrow["{d_A}", from=2-2, to=3-2]
		\arrow["{d_A}", from=3-2, to=4-2]
		\arrow["{d_A}", from=4-2, to=5-2]
		\arrow["{d_B}", from=1-3, to=2-3]
		\arrow["{d_B}", from=2-3, to=3-3]
		\arrow["{d_B}", from=3-3, to=4-3]
		\arrow["{d_B}", from=4-3, to=5-3]
		\arrow["{d_C}", from=1-4, to=2-4]
		\arrow["{d_C}", from=2-4, to=3-4]
		\arrow["{d_C}", from=3-4, to=4-4]
		\arrow["{d_C}", from=4-4, to=5-4]
	\end{tikzcd}
\end{center}
where all squares commute since \( f, g \) are chain maps, and all rows are exact.
\begin{lemma}[snake lemma]
	Let
	\begin{tikzcd}
		0 & {A_\bullet} & {B_\bullet} & {C_\bullet} & 0
		\arrow[from=1-1, to=1-2]
		\arrow["f", from=1-2, to=1-3]
		\arrow["g", from=1-3, to=1-4]
		\arrow[from=1-4, to=1-5]
	\end{tikzcd}
	be a short exact sequence of chain complexes.
	Then there is an exact sequence
	\begin{center}
		% https://tex.stackexchange.com/a/82774
		\begin{tikzcd}
			H_k(A) \rar{f_\star} & H_k(B) \rar{g_\star}
					   \ar[draw=none]{d}[name=X, anchor=center]{}
			  & H_k(C) \ar[rounded corners,
					  to path={ -- ([xshift=2ex]\tikztostart.east)
								|- (X.center) \tikztonodes
								-| ([xshift=-2ex]\tikztotarget.west)
								-- (\tikztotarget)}]{dll}[at end]{\partial_k} \\
			H_{k-1}(A) \rar{f_\star} & H_{k-1}(B) \rar{g_\star} & H_{k-1}(C)
		  \end{tikzcd}
	\end{center}
	The homomorphism \( \partial_k \) is called the \emph{connecting homomorphism}.
	Since this exists for all \( k \), this gives a long exact sequence of homology groups.
\end{lemma}
\begin{proof}
	Let \( [c] \in H_k(C) \), so \( dc = 0 \).
	Then,
	\begin{enumerate}
		\item \( g \) is surjective, so we can choose \( b \in B_k \) such that \( g(b) \in c \).
		\item \( g(db) = dg(b) = dc = 0 \), so \( db \in \ker g \).
			Since the sequence is exact at \( B \), we have \( db = f(a) \) for some \( a \in A_{k-1} \).
		\item \( f(da) = d(fa) = d^2(b) = 0 \).
			Since \( f \) is injective, \( da = 0 \).
	\end{enumerate}
	We then define \( \partial_k[c] = [a] \in H_{k-1}(A) \).
	To visualise the above argument, the following diagrams can be overlaid; the first diagram shows the groups, and the second diagram shows the corresponding elements.
	\begin{center}
		\begin{tikzcd}
			0 && {A_k} && {B_k} && {C_k} && 0 \\
			\\
			0 && {A_{k-1}} && {B_{k-1}} && {C_{k-1}} && 0 \\
			\\
			&&&& b && c \\
			\\
			&& a && db
			\arrow[from=1-1, to=1-3]
			\arrow["f", from=1-3, to=1-5]
			\arrow["g", from=1-5, to=1-7]
			\arrow[from=1-7, to=1-9]
			\arrow[from=3-1, to=3-3]
			\arrow["f", from=3-3, to=3-5]
			\arrow["g", from=3-5, to=3-7]
			\arrow[from=3-7, to=3-9]
			\arrow["{d_A}", from=1-3, to=3-3]
			\arrow["{d_B}", from=1-5, to=3-5]
			\arrow["{d_C}", from=1-7, to=3-7]
			\arrow["{\partial_k}"{pos=0.3}, dashed, curve={height=12pt}, from=1-7, to=3-3]
			\arrow["g", maps to, from=5-5, to=5-7]
			\arrow["{d_B}", maps to, from=5-5, to=7-5]
			\arrow["f", maps to, from=7-3, to=7-5]
			\arrow["{\partial_k}"{pos=0.3}, dashed, curve={height=12pt}, maps to, from=5-7, to=7-3]
		\end{tikzcd}
	\end{center}
	This definition does not depend on any choices that we made; for example, \( [c] = [c'] \) implies \( \partial_k[c] = \partial_k[c'] \).
	\begin{enumerate}
		\item If \( g(b') = c \), then \( g(b-b') = 0 \).
			By exactness, \( b - b' = f(\alpha) \).
			Then \( db - db' = f(d(\alpha)) \).
			Let \( f(a) = db \) and \( f(a') = db' \).
			So \( a - a' = d\alpha \), so \( [a] = [a'] \).
		\item Suppose \( [c] = [c'] \).
			Then \( c - c' = d\gamma \) for \( \gamma \in C_{k+1} \).
			\( g \) is surjective, so let \( \gamma = g(\beta) \).
			Then \( b - b' = d\beta \), so \( db = db' \).
			Since \( a = a' \), we have \( [a] = [a'] \).
	\end{enumerate}
	We need to check exactness.
	We will show that \( \ker \subseteq \Im \) in each case, the other direction is left as an exercise.
	\begin{enumerate}
		\item Consider \( H_k(C) \).
			If \( \partial_k[c] = 0 \), then \( a = d\alpha \) for \( \alpha \in A_k \).
			Then \( d(f(\alpha)) = f(d\alpha) = f(a) = db \).
			So \( d(b - f(\alpha)) = 0 \), giving \( [b - f(\alpha)] \in H_k(B) \).
			Then \( g_\star[b-f(\alpha)] = [g(b) - g(f(\alpha))] = [g(b)] = [c] \) by exactness.
			So \( [c] \in \Im g_\star \) as required.
		\item Consider \( H_k(B) \).
			If \( g_\star[b] = 0 \), then \( g(b) = d\gamma \) for some \( \gamma \in C_{k+1} \).
			\( g \) is surjective, so \( \gamma = g(\beta) \) for \( \beta \in B_{k+1} \).
			Then \( g(b - d\beta) = c - dg(\beta) = c - c = 0 \), so \( b - d\beta = f(\alpha) \) for \( \alpha \in A_k \).
			So \( f(d\alpha) = df(\alpha) = db - d^2\beta = 0 \).
			Hence \( [b] = [b - d\beta] = f_\star[\alpha] \).
			So \( [\beta] \in \Im f_\star \).
		\item Consider \( H_{k-1}(A) \).
			If \( f_\star[a] = 0 \), then \( f(a) = db \) for some \( b \) in \( B_{k-1} \).
			Then \( [a] = \partial_k [g(b)] \) since \( dg(b) = g(db) = g(f(a)) = 0 \).
			So \( [a] \in \Im \partial_k \).
	\end{enumerate}
\end{proof}
\begin{example}
	Let \( B = C_\bullet(\bm\Delta^n) \), and \( A = C_\bullet(\mathbb S^{n-1}) \).
	Let \( C \) be defined by
	\[ C_k = \begin{cases}
		\genset{e_{0 \dots n}} & k = n \\
		0 & \text{otherwise}
	\end{cases} \]
	Note that
	\[ H_k(C) = \begin{cases}
		\mathbb Z & k = n \\
		0 & \text{otherwise}
	\end{cases} \]
	Let \( n > 1 \).
	Then we have a short exact sequence
	\begin{tikzcd}
		0 & {\mathbb S^{n-1}} & {\bm\Delta^n} & {C} & 0
		\arrow[from=1-1, to=1-2]
		\arrow["f", from=1-2, to=1-3]
		\arrow["g", from=1-3, to=1-4]
		\arrow[from=1-4, to=1-5]
	\end{tikzcd}
	and hence we have
	\begin{center}
		\begin{tikzcd}
			H_k(\mathbb S^{n-1}) \rar{f_\star} & H_k(\bm\Delta^n) \rar{g_\star}
					   \ar[draw=none]{d}[name=X, anchor=center]{}
			  & H_k(C) \ar[rounded corners,
					  to path={ -- ([xshift=2ex]\tikztostart.east)
								|- (X.center) \tikztonodes
								-| ([xshift=-2ex]\tikztotarget.west)
								-- (\tikztotarget)}]{dll}[at end]{\partial_k} \\
			H_{k-1}(\mathbb S^{n-1}) \rar{f_\star} & H_{k-1}(\bm\Delta^n) \rar{g_\star} & H_{k-1}(C)
		  \end{tikzcd}
	\end{center}
	Now, letting \( k = n \), we can therefore find the exact sequence
	\begin{center}
		\begin{tikzcd}
			H_n(\mathbb S^{n-1}) \rar & 0 \rar
					   \ar[draw=none]{d}[name=X, anchor=center]{}
			  & \mathbb Z \ar[rounded corners,
					  to path={ -- ([xshift=2ex]\tikztostart.east)
								|- (X.center) \tikztonodes
								-| ([xshift=-2ex]\tikztotarget.west)
								-- (\tikztotarget)}]{dll}[at end]{\partial_k} \\
			H_{n-1}(\mathbb S^{n-1}) \rar & 0 \rar & 0
		  \end{tikzcd}
	\end{center}
	By exactness at \( \mathbb Z \) and \( H_{n-1}(\mathbb S^{n-1}) \), \( \partial_k \) is an isomorphism.
	Hence \( H_{n-1}(\mathbb S^{n-1}) = \mathbb Z \).
\end{example}

\subsection{Mayer--Vietoris sequence}
Let \( K_1, K_2 \) be abstract simplicial complexes in \( \Delta^n \).
Then \( K_1 \cap K_2 \) and \( K_1 \cup K_2 \) are also abstract simplicial complexes in \( \Delta^n \).
We have the following commutative square of simplicial maps given by inclusion.
\begin{center}
	\begin{tikzcd}
		& {K_1} \\
		{K_1 \cap K_2} && {K_1 \cup K_2} \\
		& {K_2}
		\arrow["{i_1}", from=2-1, to=1-2]
		\arrow["{j_1}", from=1-2, to=2-3]
		\arrow["{i_2}"', from=2-1, to=3-2]
		\arrow["{j_2}"', from=3-2, to=2-3]
	\end{tikzcd}
\end{center}
This induces a commutative square of chain maps as shown.
\begin{center}
	\begin{tikzcd}
		& {C_\bullet(K_1)} \\
		{C_\bullet(K_1 \cap K_2)} && {C_\bullet(K_1 \cup K_2)} \\
		& {C_\bullet(K_2)}
		\arrow["{i_{1\sharp}}", from=2-1, to=1-2]
		\arrow["{j_{1\sharp}}", from=1-2, to=2-3]
		\arrow["{i_{2\sharp}}"', from=2-1, to=3-2]
		\arrow["{j_{2\sharp}}"', from=3-2, to=2-3]
	\end{tikzcd}
\end{center}
\begin{proposition}
	Let \( K_1, K_2 \) be abstract simplicial complexes in \( \Delta^n \).
	Then the sequence
	\begin{center}
		\begin{tikzcd}
			0 & {C_\bullet(K_1 \cap K_2)} & {C_\bullet(K_1) \oplus C_\bullet(K_2)} & {C_\bullet(K_1\cup K_2)} & 0
			\arrow[from=1-1, to=1-2]
			\arrow["i", from=1-2, to=1-3]
			\arrow["j", from=1-3, to=1-4]
			\arrow[from=1-4, to=1-5]
		\end{tikzcd}
	\end{center}
	is a short exact sequence of chain complexes, where
	\[ i = \begin{pmatrix}i_{1\sharp}\\i_{2\sharp}\end{pmatrix};\quad j = \begin{pmatrix}j_{1\sharp}&-j_{2\sharp}\end{pmatrix} \]
\end{proposition}
\begin{proof}
	We must check exactness at each location.
	\( i_{1\sharp} \) is injective, so \( i \) is injective.

	If \( j((a, b)) = 0 \), then \( j_{1\sharp}(a) = j_{2\sharp}(b) \), so \( a = b \in C_\bullet(K_1) \cap C_\bullet(K_2) = C_\bullet(K_1 \cap K_2) \).
	Hence \( (a, b) = i(a) \), so \( \ker j \subseteq \Im i \).
	For the other direction, \( gf(a) = (j_{1\sharp} \circ i_{1\sharp})(a) - (j_{2\sharp} \circ i_{2\sharp}(a)) = 0 \) since the square of inclusion maps commutes.
	So \( \Im i \subseteq \ker j \), so the sequence is exact at \( C_\bullet(K_1) \oplus C_\bullet(K_2) \).

	Let \( e_I \in K_1 \cup K_2 \).
	Then \( e_I \in K_1 \) or \( e_I \in K_2 \).
	If \( e_I \in K_1 \) then \( e_I = j((e_I, 0)) \).
	If \( e_I \in K_2 \) then \( e_I = j((0, -e_I)) \).
	So \( e_I \in \Im j \) in either case.
	Since the \( e_I \) form a free basis, \( j \) is surjective as required.
\end{proof}
\begin{theorem}[Mayer--Vietoris sequence]
	Let \( K_1, K_2 \) be abstract simplicial complexes in \( \Delta^n \).
	Then there is a long exact sequence
	\begin{center}
		\begin{tikzcd}
			H_k(K_1 \cap K_2) \rar{i_\star} & H_k(K_1) \oplus H_k(K_2) \rar{j_\star}
					   \ar[draw=none]{d}[name=X, anchor=center]{}
			  & H_k(K_1 \cup K_2) \ar[rounded corners,
					  to path={ -- ([xshift=2ex]\tikztostart.east)
								|- (X.center) \tikztonodes
								-| ([xshift=-2ex]\tikztotarget.west)
								-- (\tikztotarget)}]{dll}[at end]{\partial_k} \\
			H_{k-1}(K_1 \cap K_2) \rar{i_\star} & H_{k-1}(K_1) \oplus H_{k-1}(K_2) \rar{j_\star} & H_{k-1}(K_1 \cup K_2)
		  \end{tikzcd}
	\end{center}
\end{theorem}
\begin{proof}
	Follows from the above theorem and the snake lemma.
\end{proof}
\begin{example}
	Let \( K_1, K_2 \) be abstract simplicial complexes in \( \Delta^n, \Delta^m \).
	Then let \( K_1 \amalg K_2 \subset \Delta^{n+m+1} \) be the abstract simplicial complex where the vertices of \( \Delta^{n+m+1} \) are \( e_0, \dots, e_n, e_0', \dots, e_m' \), and we embed \( K_1 \) and \( K_2 \) into \( K_1 \amalg K_2 \) in the natural way.
	More precisely, \( e_I \in K_1 \) gives \( e_I \in K_1 \amalg K_2 \), and \( e_I \in K_2 \) gives \( e'_J \in K_1 \amalg K_2 \).
	Then \( \abs{K_1 \amalg K_2} = \abs{K_1} \amalg \abs{K_2} \).
	\( K_1 \amalg K_2 = K_1 \cup K_2' \) where \( K_1, K_2' \) are disjoint abstract simplicial complexes in \( \Delta^{n+m+1} \), so \( K_1 \cap K_2' = \qty{e_\varnothing} \).
	The Mayer--Vietoris sequence gives
	\begin{center}
		\begin{tikzcd}
			H_k(\qty{e_\varnothing}) \rar{i_\star} & H_k(K_1) \oplus H_k(K_2) \rar{j_\star}
					   \ar[draw=none]{d}[name=X, anchor=center]{}
			  & H_k(K_1 \amalg K_2) \ar[rounded corners,
					  to path={ -- ([xshift=2ex]\tikztostart.east)
								|- (X.center) \tikztonodes
								-| ([xshift=-2ex]\tikztotarget.west)
								-- (\tikztotarget)}]{dll}[at end]{\partial_k} \\
			H_{k-1}(\qty{e_\varnothing}) \rar{i_\star} & H_{k-1}(K_1) \oplus H_{k-1}(K_2) \rar{j_\star} & H_{k-1}(K_1 \amalg K_2)
		  \end{tikzcd}
	\end{center}
	Note that \( H_k(\qty{e_\varnothing}) = 0 \).
	Hence, the sequence
	\begin{center}
		\begin{tikzcd}
			0 & {H_k(K_1) \oplus H_k(K_2)} & {H_k(K_1 \amalg K_2)} & 0
			\arrow[from=1-1, to=1-2]
			\arrow[from=1-2, to=1-3]
			\arrow[from=1-3, to=1-4]
		\end{tikzcd}
	\end{center}
	is exact.
	So \( H_k(K_1) \oplus H_k(K_2) \simeq H_k(K_1 \amalg K_2) \).
\end{example}

\subsection{Homology of triangulable spaces}
\begin{theorem}
	Let \( f_0, f_1 \colon K \to L \) be simplicial approximations to a continuous map \( F \colon \abs{K} \to \abs{L} \).
	Then \( f_{0\sharp} \sim f_{1\sharp} \), so \( f_{0\star} = f_{1\star} \).
\end{theorem}
\begin{theorem}
	There is an isomorphism \( \nu_K \colon H_\bullet(B K) \to H_\bullet(K) \) such that \( \nu_K = f_\star \) where \( f \colon B K \to K \) is any simplicial approximation to the identity map on \( \abs{K} \).
	% TODO: diagram
\end{theorem}
\begin{definition}
	Let \( F \colon \abs{K} \to \abs{L} \) be continuous.
	By the simplicial approximation theorem, there exists \( f \colon B^r \to L \) that is a simplicial approximation to \( F \).
	Define \( F_\star \colon H_\bullet(K) \to H_\bullet(L) \) by \( F_\star = f_\star \circ \nu_{K,r}^{-1} \).
\end{definition}
\begin{theorem}
	\( F_\star \) is well-defined, so does not depend on the choice of \( f \).
	\( (\mathrm{id}_K)_\star = \mathrm{id}_{H_\bullet(K)} \).
	Further, \( (F \circ G)_\star = F_\star \circ G_\star \).
\end{theorem}
\begin{theorem}
	Let \( F_0, F_1 \colon \abs{K} \to \abs{L} \) be continuous with \( F_0 \sim F_1 \).
	Then \( F_{0\star} = F_{1\star} \).
\end{theorem}
\begin{proposition}
	Let \( \abs{K} \sim \abs{L} \).
	Then \( H_\bullet(K) \simeq H_\bullet(L) \).
\end{proposition}
\begin{proof}
	Let \( F \colon \abs{K} \to \abs{L} \) and \( G \colon \abs{L} \to \abs{K} \) be functions such that \( F \circ G \sim \mathrm{id}_{\abs{L}} \) and \( G \circ F \sim \mathrm{id}_{\abs{K}} \).
	Then \( F_\star \circ G_\star = \mathrm{id}_{H_\bullet(L)} \) and \( G_\star \circ F_\star = \mathrm{id}_{H_\bullet(K)} \) by functoriality.
	Hence \( F_\star \) and \( G_\star \) are inverse isomorphisms of groups.
\end{proof}
\begin{definition}
	A space \( X \) is \emph{triangulable} if there exists an abstract simplicial complex \( K \) with \( \abs{K} \simeq X \).
\end{definition}
\begin{remark}
	The above proposition implies that if \( X \) is triangulable, there is a well-defined homology group \( H_\bullet(X) = H_\bullet(K) \) where \( K \) is any abstract simplicial complex with polyhedron \( \abs{K} \simeq X \).
	Not all topological spaces are homotopy equivalent to a triangulable space.
	One example is \( \bigvee_{i=1}^\infty S^1 \).
\end{remark}
\begin{proposition}
	Let \( \abs{K} \) be path-connected.
	Then \( H_0(K) \simeq \mathbb Z \).
\end{proposition}
\begin{proof}
	\( C_0(K) \) is generated by the vertices \( e_i \) of \( K \).
	Consider \( F_i \colon \Delta^0 \to \abs{K} \) mapping \( e_0 \in \Delta^0 \) to \( e_i \in K \).
	Then \( H_\star(\Delta^0) = \mathbb Z = \genset{[e_0]} \), and \( F_\star([e_0]) = [e_i] \).
	Since \( K \) is path-connected, \( F_i \sim F_j \).
	So \( [e_i] = F_{i\star}([e_0]) = F_{j\star}([e_0]) = [e_j] \).
	Hence all \( [e_i] \) are equal.
	The \( [e_i] \) are not boundaries, so \( H_0(K) \) is not trivial.
\end{proof}
\begin{corollary}
	\( H_0(K) = \mathbb Z^k \) where \( k \) is the number of path-connected components of \( \abs{K} \).
\end{corollary}
\begin{proof}
	\( \abs{K} \) is a disjoint union of the \( k \) path-connected components of \( \abs{K} \), so \( H_0(K) \) is the direct sum of the homology groups of these components.
\end{proof}
We know \( S^n \simeq \abs{\mathbb S^n} \), so
\[ H_k(S^n) = H_k(\mathbb S^n) = \begin{cases}
	\mathbb Z & k = 0, n \\
	0 & \text{otherwise}
\end{cases} \]
Hence \( S^n \sim S^m \) implies \( n = m \).
\begin{corollary}
	\( \mathbb R^n \simeq \mathbb R^m \) implies \( n = m \).
\end{corollary}
\begin{proof}
	Let \( f \colon \mathbb R^n \to \mathbb R^m \) be a homeomorphism.
	Then \( S^{n-1} \sim \mathbb R^n \setminus \qty{0} \simeq \mathbb R^m \setminus \qty{f(0)} \sim S^{m-1} \).
	So \( S^{n-1} \sim S^{m-1} \), giving \( n = m \).
\end{proof}
\begin{corollary}
	There is no retraction \( r \colon D^n \to S^{n-1} \).
\end{corollary}
\begin{proof}
	We suppose \( n > 0 \).
	Let \( j \colon S^{n-1} \to D^n \) be the inclusion.
	\( r \) is a retraction if and only if \( r \circ j = \mathrm{id}_{S^{n-1}} \).
	This gives \( (r \circ j)_\star = \mathrm{id}_{H_\bullet(S^{n-1})} \).
	Note that \( H_{n-1}(D^n) = H_{n-1}(\bm\Delta^n) = 0 \), and \( H_{n-1}(S^{n-1}) = \mathbb Z \).
	If \( r \) is a retraction, then \( r_\star \) and \( j_\star \) are inverse homomorphisms of groups, but \( \mathbb Z \) is not isomorphic to \( 0 \).
	So \( r \) is not a retraction.
\end{proof}
\begin{theorem}[Brouwer fixed point theorem]
	Let \( F \colon D^n \to D^n \) be a continuous function.
	Then \( F \) has a fixed point.
\end{theorem}
\begin{remark}
	This is a generalisation of the intermediate value theorem for high dimensions.
\end{remark}
\begin{proof}
	Suppose there is no fixed point.
	Then, we define \( G \colon D^n \to S^{n-1} \) by letting \( G(x), x, F(x) \) lie in this order on a straight line in \( D^n \).
	If \( G \) is a well-defined continuous map, it is a retraction, contradicting the previous result.

	Let \( p \in D^n \) and \( v \in S^{n-1} \).
	Let \( R_{p,v} = \qty{p + tv \mid t \geq 0} \).
	If \( p + tv \in S^{n-1} \), then \( \inner{p + tv, p + tv} = 1 \), so \( \inner{p,p} + 2t \inner{v,p} + t^2 = 1 \).
	Hence
	\[ t = -\inner{p,v} \pm \sqrt{\inner{p,v}^2 + 1 - \inner{p,p}} \]
	We define
	\[ \tau(p,v) = \max\qty(-\inner{p,v} \pm \sqrt{\inner{p,v}^2 + 1 - \inner{p,p}}) \]
	This is a continuous function.
	Now, we define \( P(p,v) = p + \tau(p,v) v \), which is the intersection of \( R_{p,v} \) with \( S^{n-1} \), which is also continuous.
	So
	\[ G(x) = P\qty(F(x), \frac{x - F(x)}{\norm{x - F(x)}}) \]
	is well-defined and continuous.
\end{proof}

\subsection{Homology of orientable surfaces}
We can often compute homology groups only using the Mayer--Vietoris sequence and functoriality properties.
\begin{example}
	Consider the torus \( T^2 \).
	We can write a triangulation \( K \) of \( T^2 \) as \( K_1 \cup K_2 \), with \( \abs{K_i} \simeq S^1 \times I \), and \( \abs{K_1 \cap K_2} \simeq S_1^1 \amalg S_2^1 \).
	Note that the inclusion \( \iota_{j,i} \colon S_j^1 \hookrightarrow \abs{K_i} \) is a homotopy equivalence, and \( \iota_{1,i} \sim \iota_{2,i} \).
	Then the Mayer--Vietoris sequence gives
	\[\begin{tikzcd}
		& {H_2(K_1)\oplus H_2(K_2)} \ar[draw=none]{d}[name=X, anchor=center]{} & {H_2(K)} \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (X.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll} \\
		{H_1(K_1 \cap K_2)} & {H_1(K_1) \oplus H_1(K_2)} \ar[draw=none]{d}[name=Y, anchor=center]{} & {H_1(K)} \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (Y.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll} \\
		{H_0(K_1 \cap K_2)} & {H_0(K_1) \oplus H_0(K_2)} & {H_0(K)} & 0
		\arrow[from=1-2, to=1-3]
		\arrow["{\alpha_1}"', from=2-1, to=2-2]
		\arrow[from=2-2, to=2-3]
		\arrow["{\alpha_0}"', from=3-1, to=3-2]
		\arrow[from=3-2, to=3-3]
		\arrow[from=3-3, to=3-4]
	\end{tikzcd}\]
	giving
	\[\begin{tikzcd}
		& 0 \ar[draw=none]{d}[name=Y, anchor=center]{} & {H_2(K)} \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (X.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll} \\
		{\mathbb Z \oplus \mathbb Z} & {\mathbb Z \oplus \mathbb Z} \ar[draw=none]{d}[name=Y, anchor=center]{} & {H_1(K)} \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (Y.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll} \\
		{\mathbb Z \oplus \mathbb Z} & {\mathbb Z \oplus \mathbb Z} & {H_0(K)} & 0
		\arrow[from=1-2, to=1-3]
		\arrow["{\alpha_1}"', from=2-1, to=2-2]
		\arrow[from=2-2, to=2-3]
		\arrow["{\alpha_0}"', from=3-1, to=3-2]
		\arrow[from=3-2, to=3-3]
		\arrow[from=3-3, to=3-4]
	\end{tikzcd}\]
	Hence we have short exact sequences
	\[\begin{tikzcd}
		0 & {H_2(K)} & {\ker \alpha_1} & 0 \\
		0 & {\coker \alpha_1} & {H_1(K)} & {\ker \alpha_0} & 0 \\
		0 & {\coker \alpha_0} & {H_0(K)} & 0
		\arrow[from=1-1, to=1-2]
		\arrow[from=1-2, to=1-3]
		\arrow[from=1-3, to=1-4]
		\arrow[from=2-1, to=2-2]
		\arrow[from=2-2, to=2-3]
		\arrow[from=2-3, to=2-4]
		\arrow[from=2-4, to=2-5]
		\arrow[from=3-1, to=3-2]
		\arrow[from=3-2, to=3-3]
		\arrow[from=3-3, to=3-4]
	\end{tikzcd}\]
	The maps \( \alpha_i \) are given by the matrix \( \begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix} \).
	Therefore, \( \ker \alpha_i \simeq \mathbb Z \) and \( \coker \alpha_i \simeq \mathbb Z \).
	Hence \( H_2(K) \simeq \mathbb Z \), \( H_1(K) \simeq \mathbb Z^2 \), and \( H_0(K) \simeq \mathbb Z \).
	\[ H_k(T^2) = \begin{cases}
		\mathbb Z & k = 0, 2 \\
		\mathbb Z^2 & k = 1 \\
		0 & \text{otherwise}
	\end{cases} \]
\end{example}
\begin{proposition}
	Suppose that
	\begin{tikzcd}
		0 & A & B & {\mathbb Z^r} & 0
		\arrow[from=1-1, to=1-2]
		\arrow[from=1-2, to=1-3]
		\arrow[from=1-3, to=1-4]
		\arrow[from=1-4, to=1-5]
	\end{tikzcd}
	is exact.
	Then \( B \simeq A \oplus \mathbb Z^r \).
\end{proposition}
\begin{proof}
	By exactness, \( \mathbb Z^r \simeq \faktor{B}{A} \).
	The result then follows from the structure theorem for abelian groups.
\end{proof}
\begin{example}
	Let \( L_1 \) be a triangulation of \( T^2 \), and let \( L_{1,1} \) be \( L_1 \setminus \qty{\sigma} \) where \( \sigma \) is a 2-simplex.
	Then \( \partial L_{1,1} \simeq \partial \sigma = \mathbb S^1 \), and \( \abs{L_{1,1}} \sim S^1 \vee S^1 \).
	We inductively define \( L_g = L_{g-1,1} \cup_{\mathbb S^1} L_{1,1} \), and \( L_{g,1} = L_g \setminus \sigma \) where \( \sigma \) is a 2-simplex.
	Then \( L_g \) is a triangulation of the compact surface of genus \( g \).
	Note also that \( L_{g,1} \simeq L_{g-1,1} \cup_{\sigma^1} L_{1,1} \) where \( \sigma^1 \) is an edge of \( \mathbb S^1 \).
	% TODO: somehow this diagram
	So \( L_{g,1} \sim \bigvee_{i=1}^{2g} S^1 \).
\end{example}
\begin{proposition}
	\[ H_k(L_g) = \begin{cases}
		\mathbb Z & k = 0, 2 \\
		\mathbb Z^{2g} & k = 1 \\
		0 & \text{otherwise}
	\end{cases} \]
	and
	\[ H_k(L_{g,1}) = \begin{cases}
		\mathbb Z & k = 0 \\
		\mathbb Z^{2g} & k = 1 \\
		0 & \text{otherwise}
	\end{cases} \]
	Further, \( \iota_{g\star} \colon H_1(\partial L_{g,1}) \to H_1(L_{g,1}) \) is the zero map.
\end{proposition}
\begin{proof}
	By induction, we show the result for \( H_k(L_g) \) implies the result for \( H_k(L_{g,1}) \), and then \( H_k(L_{g,1}) \) gives \( H_k(L_{g+1}) \).
	The base case is \( H_\bullet(T^2) \) which was shown above.
	For the first implication, we use the Mayer--Vietoris sequence.
	Note that \( L_g = L_{g,1} \cup_{\partial L_{g,1}} \bm\Delta^2 \).
	Then,
	\[\begin{tikzcd}
		& {H_2(L_{g,1}) \oplus H_2(\bm\Delta^2)} \ar[draw=none]{d}[name=X, anchor=center]{} & {H_2(L_g)} \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (X.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll}[at end]{\partial_2} \\
		{H_1(\partial L_{g,1})} & {H_1(L_{g,1}) \oplus H_1(\bm\Delta^2)} \ar[draw=none]{d}[name=Y, anchor=center]{} & {H_1(L_g)} \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (Y.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll}[at end]{\partial_1} \\
		{H_0(\partial L_{g,1})} & {H_0(L_{g,1}) \oplus H_0(\bm\Delta^2)} & {H_0(L_g)}
		\arrow[from=1-2, to=1-3]
		\arrow["{\iota_1}"', from=2-1, to=2-2]
		\arrow[from=2-2, to=2-3]
		\arrow["{\iota_0}"', from=3-1, to=3-2]
		\arrow[from=3-2, to=3-3]
	\end{tikzcd}\]
	giving
	\[\begin{tikzcd}
		& {0 \oplus 0} \ar[draw=none]{d}[name=X, anchor=center]{} & {\mathbb Z} \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (X.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll}[at end]{\partial_2} \\
		{\mathbb Z} & {H_1(L_{g,1}) \oplus 0} \ar[draw=none]{d}[name=Y, anchor=center]{} & {\mathbb Z^{2g}} \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (Y.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll}[at end]{\partial_1} \\
		{\mathbb Z} & {\mathbb Z \oplus \mathbb Z} & {\mathbb Z}
		\arrow[from=1-2, to=1-3]
		\arrow["{\iota_1}"', from=2-1, to=2-2]
		\arrow[from=2-2, to=2-3]
		\arrow["{\iota_0}"', from=3-1, to=3-2]
		\arrow[from=3-2, to=3-3]
	\end{tikzcd}\]
	The bottom row of the Mayer--Vietoris sequence always has this form if \( K_1, K_2, K_1 \cap K_2 \) are connected.
	Note that since \( \iota_0 \) is injective, the map before it is the zero map by exactness, so we can remove the bottom row and replace it with zero.
	We have that \( \partial_2 \) is injective, and \( H_1(L_{g,1}) \) is torsion-free, so \( \partial_2 \) is an isomorphism.
	Hence \( \iota_1 \) is the zero map and \( j \) is an isomorphism.
	Since \( 0 = \iota_1 = \iota_{g\star} + \iota'_\star \), we have \( \iota_{g\star} = 0 \).
	Further, as \( j \) is an isomorphism, \( H_1(L_{g,1}) \simeq H_1(L_g) = \mathbb Z^{2g} \) as required.

	Now we show the result for \( H_k(L_{g,1}) \) implies the result for \( H_k(L_{g+1}) \).
	Note that \( L_{g+1} = L_{g,1} \cup_{\partial L_{g,1}} L_{1,1} \).
	Hence,
	\[\begin{tikzcd}
		& {H_2(L_{g,1}) \oplus H_2(L_{1,1})} \ar[draw=none]{d}[name=X, anchor=center]{} & {H_2(L_{g+1})} \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (X.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll} \\
		{H_1(\partial L_{g,1})} & {H_1(L_{g,1}) \oplus H_2(L_{1,1})} & {H_1(L_{g+1})} & 0
		\arrow[from=1-2, to=1-3]
		\arrow["{\iota}"', from=2-1, to=2-2]
		\arrow[from=2-2, to=2-3]
		\arrow[from=2-3, to=2-4]
	\end{tikzcd}\]
	so
	\[\begin{tikzcd}
		& {0 \oplus 0} \ar[draw=none]{d}[name=X, anchor=center]{} & {H_2(L_{g+1})} \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (X.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll} \\
		{\mathbb Z} & {\mathbb Z^{2g} \oplus \mathbb Z^2} & {H_1(L_{g+1})} & 0
		\arrow[from=1-2, to=1-3]
		\arrow["{\iota}"', from=2-1, to=2-2]
		\arrow[from=2-2, to=2-3]
		\arrow[from=2-3, to=2-4]
	\end{tikzcd}\]
	By assumption, \( \iota \) is the zero map.
	Hence \( H_2(L_{g+1}) \simeq H_1(\partial L_{g,1}) \simeq \mathbb Z \) as \( \partial_2 \) is an isomorphism.
	Also, \( \mathbb Z^{2g+2} \simeq H_1(L_{g+1}) \) by exactness.
\end{proof}

\subsection{Homology of non-orientable surfaces}
Let \( M_1 \) be a triangulation of \( \mathbb R \mathbb P^2 \).
Let \( M_{r,1} \) be \( M_r \) with a 2-simplex removed, so \( \partial M_{r,1} \simeq \mathbb S^1 \).
Let \( M_{r+1} = M_{r,1} \cup_{\partial M_{r,1}} M_{1,1} \).
Then \( M_{r+1,1} = M_{r,1} \cup_{\bm\Delta^1} M_{1,1} \), attaching along an interval.
For example, \( \abs{M_{1,1}} \) is homeomorphic to the M\"obius band.
% TODO: diagram
Then \( M_{r,1} \sim \bigvee_{i=1}^r S^1 \).
\begin{proposition}
	\[ H_k(M_r) = \begin{cases}
		\mathbb Z^{r-1} \oplus \faktor{\mathbb Z}{2\mathbb Z} & k = 1 \\
		\mathbb Z & k = 0 \\
		0 & \text{otherwise}
	\end{cases} \]
	and
	\[ H_k(M_{r,1}) = \begin{cases}
		\mathbb Z^r & k = 1 \\
		\mathbb Z & k = 0 \\
		0 & \text{otherwise}
	\end{cases} \]
	Further, \( \iota_{r\star} \colon H_1(\partial M_{r,1}) \to H_1(M_{r,1}) \) has the property that \( \iota_{r\star}(1) \) is twice a primitive element, or equivalently, \( \faktor{H_1(M_{r,1})}{\Im \iota_{r\star}} = \mathbb Z^{r-1} \oplus \faktor{\mathbb Z}{2\mathbb Z} \).
\end{proposition}
\begin{proof}
	We proceed by induction in the same way.
	For the base case, note that \( \partial M_{1,1} \simeq S^1 \) and \( M_{1,1} \simeq S^1 \), and the map from \( \partial M_{1,1} \to M_{1,1} \) is given by \( z \mapsto z^2 \), so the map \( H_1(S^1) \to H_1(S^1) \) is given by multiplication by 2.
	Suppose the result holds for \( H_k(M_r) \).
	Then, \( M_r = M_{r,1} \cup_{\partial M_{r,1}} \bm\Delta^2 \), and
	\[\begin{tikzcd}
		& {H_2(M_{r,1})\oplus H_2(\bm\Delta^2)} \ar[draw=none]{d}[name=X, anchor=center]{} & {H_2(M_r)} \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (X.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll} \\
		{H_1(\partial M_{r,1})} & {H_1(M_{r,1}) \oplus H_1(\bm\Delta^2)} & {H_1(M_r)} & 0
		\arrow[from=1-2, to=1-3]
		\arrow["{\iota_{r\star}}"', from=2-1, to=2-2]
		\arrow[from=2-2, to=2-3]
		\arrow[from=2-3, to=2-4]
	\end{tikzcd}\]
	\( \iota_{r\star} \) is injective, so \( \partial_2 = 0 \), giving
	\begin{tikzcd}
		0 & {H_2(M_r)} & 0
		\arrow[from=1-1, to=1-2]
		\arrow[from=1-2, to=1-3]
	\end{tikzcd}.
	Hence,
	\[\begin{tikzcd}
		& {0 \oplus 0} \ar[draw=none]{d}[name=X, anchor=center]{} & {0} \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (X.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll} \\
		{\mathbb Z} & {H_1(M_{r,1}) \oplus 0} & {\mathbb Z^{r-1} \oplus \faktor{\mathbb Z}{2\mathbb Z}} & 0
		\arrow[from=1-2, to=1-3]
		\arrow["{\iota_{r\star}}"', from=2-1, to=2-2]
		\arrow[from=2-2, to=2-3]
		\arrow[from=2-3, to=2-4]
	\end{tikzcd}\]
	Since \( H_1(M_{r,1}) \) is torsion-free,
	\[\begin{tikzcd}
		0 & {\mathbb Z} & {H_1(M_{r,1})} & {\mathbb Z^{r-1}\oplus\faktor{\mathbb Z}{2\mathbb Z}} & 0
		\arrow[from=1-1, to=1-2]
		\arrow[from=1-2, to=1-3]
		\arrow[from=1-3, to=1-4]
		\arrow[from=1-4, to=1-5]
	\end{tikzcd}\]
	gives that \( H_1(M_{r,1}) = \mathbb Z^r \).

	Now, \( M_{r+1} = M_{r,1} \cup_{\partial M_{r,1}} M_{1,1} \) hence
	\[\begin{tikzcd}
		& {H_2(M_{r,1}) \oplus H_2(M_{1,1})} \ar[draw=none]{d}[name=X, anchor=center]{} & {H_2(M_{r+1})} \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (X.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll} \\
		{H_1(\mathbb S^1)} & {H_1(M_{r,1}) \oplus H_1(M_{r,1})} & {H_1(M_{r+1})} & 0
		\arrow[from=1-2, to=1-3]
		\arrow[from=2-1, to=2-2]
		\arrow[from=2-2, to=2-3]
		\arrow[from=2-3, to=2-4]
	\end{tikzcd}\]
	so
	\[\begin{tikzcd}
		& {0 \oplus 0} \ar[draw=none]{d}[name=X, anchor=center]{} & 0 \ar[rounded corners,
		to path={ -- ([xshift=2ex]\tikztostart.east)
				  |- (X.center) \tikztonodes
				  -| ([xshift=-2ex]\tikztotarget.west)
				  -- (\tikztotarget)}]{dll}[at end]{0} \\
		{\mathbb Z} & {H_1(M_{r,1}) \oplus H_1(M_{r,1})} & {H_1(M_{r+1})} & 0
		\arrow[from=1-2, to=1-3]
		\arrow[from=2-1, to=2-2]
		\arrow[from=2-2, to=2-3]
		\arrow[from=2-3, to=2-4]
	\end{tikzcd}\]
	Hence \( H_1(M_{r+1}) \simeq \faktor{\mathbb Z^2 \oplus \mathbb Z}{(2e_1,2)} \simeq \mathbb Z^r \oplus \faktor{\mathbb Z}{2\mathbb Z} \).
\end{proof}

\subsection{Lefschetz fixed point theorem}
Let \( (C, d) \) be a chain complex over \( \mathbb Q \) (or any other field).
Then \( H_\bullet(C) \) is a \( \mathbb Q \)-vector space.
Let \( f \colon C \to C \) be a chain map, so it induces \( f_\star \colon H_\bullet(C) \to H_\bullet(C) \).
\( f \) and \( f_\star \) are both linear endomorphisms of vector spaces.
\begin{definition}
	The \emph{Lefschetz number} of \( f \) is \( L(f) = \sum_k (-1)^k \tr f_k \) where \( f_k \colon C_k \to C_k \), and \( L(f_\star) = \sum_k (-1)^k \tr f_{k\star} \) where \( f_{k\star} \colon H_k(C) \to H_k(C) \).
\end{definition}
\begin{proposition}
	\( L(f) = L(f_\star) \).
\end{proposition}
\begin{proof}
	Let \( U_k = \Im d_{k+1} \subseteq \ker d_k \subseteq C_k \).
	Then, \( \ker d_k = U_k \oplus V_k \), and \( C_k = U_k \oplus V_k \oplus U_k' \).
	Then \( d \colon U_k' \to U_{k-1} \) is an isomorphism.
	With respect to this decomposition, \( d \) is a matrix in block form given by
	\[ d = \begin{pmatrix}
		0 & 0 & I \\
		0 & 0 & 0 \\
		0 & 0 & 0
	\end{pmatrix} \]
	Also, \( f(\Im d_{k+1}) \subseteq \Im d_{k+1} \) since \( f \) is a chain map, and \( f(\ker d_k) \subseteq \ker d_k \).
	So in block form,
	\[ f = \begin{pmatrix}
		A_k & X_k & \star \\
		0 & B_k & \star \\
		0 & 0 & A_k'
	\end{pmatrix} \]
	Then, the equation \( df = fd \) shows \( A_k = A_{k+1}' \).
	Hence, \( H_k(C) = \faktor{\ker d_k}{\Im d_{k+1}} = \faktor{U_k \oplus V_k}{U_k} \simeq V_k \), and \( f_{k\star} \colon H_k(C) \to H_k(C) \) maps \( [v] \) to \( [B_k v + X_k v] = [B_k v] \), so \( f_{k\star} \) is multiplication by \( B_k \).
	Then \( L(f) = \sum_k (-1)^k \tr f_k = \sum (-1)^k (\tr A_k + \tr B_k + \tr A_{k-1}) = \sum (-1)^k \tr B_k = L(f_\star) \).
\end{proof}
\begin{definition}
	Let \( C = C_\bullet(K) \).
	Then the \emph{Euler characteristic} is defined by \( \chi(C) = L(\mathrm{id}_C) \).
	Hence \( \chi(C(K)) = \sum_k (-1)^k \dim C_k(K) \).
	Note that \( L(\mathrm{id}_C) = L(\mathrm{id}_{H_\bullet(K)}) = \sum_k (-1)^k \dim H_k(K) \) depends only on \( \abs{K} \).
\end{definition}
\begin{theorem}[Lefschetz fixed point theorem]
	Let \( F \colon \abs{K} \to \abs{K} \) be a continuous map.
	Let \( L(F) = L(F_\star) \) be the Lefschetz number of \( F \), where \( F_\star \colon H_\bullet(K) \to H_\bullet(K) \).
	Then if \( L(F) \neq 0 \), \( F \) has a fixed point.
\end{theorem}
\begin{remark}
	This is a generalisation of the Brouwer fixed point theorem.
\end{remark}
\begin{proof}[Proof sketch]
	If \( F \) has no fixed point, then since \( \abs{K} \) is compact, there exists \( \varepsilon > 0 \) such that \( \abs{F(x) - x} \geq \varepsilon \) for all \( x \).
	If \( f \colon B^{r+n} K \to B^r K \) is a simplicial approximation of \( F \), then the above implies that \( F_\star(\sigma) \) does not contain \( \sigma \) for any simplex \( \sigma \in C_\bullet(K) \).
	Hence \( L(F) = L(f) = 0 \).
\end{proof}
